package com.luber.backstage.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.luber.backstage.domain.EticketVehicle;
import com.luber.backstage.domain.vo.EticketVehicleVO;
import com.luber.backstage.mapper.EticketVehicleMapper;
import com.luber.backstage.service.IEticketVehicleService;
import com.luber.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author luber
 * @date 2021-03-22
 */
@Service
public class EticketVehicleServiceImpl implements IEticketVehicleService
{
    @Autowired
    private EticketVehicleMapper eticketVehicleMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param id ID
     * @return
     */
    @Override
    public EticketVehicleVO selectEticketVehicleById(Long id)
    {
        return eticketVehicleMapper.selectEticketVehicleById(id);
    }

    /**
     * 查询列表
     *
     * @param params
     * @return
     */
    @Override
    public List<EticketVehicle> selectEticketVehicleList(Map<String, Object> params)
    {
        Object startDate = params.get("createDate[0]");
        Object endDate = params.get("createDate[1]");
        params.put("startDate",startDate);
        params.put("endDate",endDate);
        params.remove("createDate[0]");
        params.remove("createDate[1]");
        return eticketVehicleMapper.selectEticketVehicleList(params);
    }

    /**
     * 新增
     *
     * @param eticketVehicle 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertEticketVehicle(EticketVehicle eticketVehicle)
    {
        eticketVehicle.setCreateDate(new Date().getTime());
        return eticketVehicleMapper.insertEticketVehicle(eticketVehicle);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param eticketVehicle 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateEticketVehicle(EticketVehicle eticketVehicle)
    {
        return eticketVehicleMapper.updateEticketVehicle(eticketVehicle);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEticketVehicleByIds(Long[] ids)
    {
        return eticketVehicleMapper.deleteEticketVehicleByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEticketVehicleById(Long id)
    {
        return eticketVehicleMapper.deleteEticketVehicleById(id);
    }
}
